var popupDialogId = 'dialogwv';
function Alert(msg){
    $('<div data-role="popup" id="' + popupDialogId + '" data-confirmed="no" data-transition="pop" data-theme="b" data-dismissible="false"> \
        <div role="main" class="ui-content" data-theme="b" style="min-width:400px;max-width:500px;height:auto;">\
            <h3 class="ui-title" style="text-align:left;">系统提示</h3>\
            <p style="text-align:center;margin-bottom:15px;margin-top:15px">'+msg+'</p>\
            <a href="#" data-role="button" data-icon="check" data-theme="b" data-rel="back">确定</a>\
        </div>\
    </div>').appendTo($.mobile.pageContainer);
    var popupDialogObj = $('#' + popupDialogId);
    popupDialogObj.trigger('create');
    popupDialogObj.popup({
        afterclose: function (event, ui) {
            popupDialogObj.find(".optionConfirm").first().off('click');
            var isConfirmed = popupDialogObj.attr('data-confirmed') === 'yes' ? true : false;
            $(event.target).remove();
            if (isConfirmed) {
               //这里执行确认需要执行的代码
            }
        }
    });
    popupDialogObj.popup('open');
    popupDialogObj.find(".optionConfirm").first().on('click', function () {
        popupDialogObj.attr('data-confirmed', 'yes');
    });
}
/**
 * 刷新
 * @param iframe
 * @returns
 */
function reFresh(iframe) {
	$('#'+iframe).attr('src', $('#'+iframe).attr('src'));
}

/**
 * 指定IFrame
 * @param frameId
 * @param src
 * @returns
 */
function doAction(iframe,src) {
	document.getElementById(iframe).src = src;
}
/**
 * 返回首页
 * @param type
 * @returns
 */
function backHome(type){
	if(type==null){
		type = "0";
	}
	window.location.href='../welcome?type='+type;
}
